﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Text;
using MsgPack;
using Eb;
using Es;

public class ServerSampleUCenter<T> : Component<T> where T : ComponentDef, new()
{
    //-------------------------------------------------------------------------
    EsUCenterSDK4Server UCenterSDK4Server { get; set; }

    //-------------------------------------------------------------------------
    public override void init(object[] list_param = null)
    {
        EbLog.Note("ServerSampleUCenter.init()");

        UCenterSDK4Server = new EsUCenterSDK4Server(EntityMgr, Entity,
            "../../../Media/SampleUCenter/EsUCenterSDK4Server.dll.config",
            _onUCenter2ProjectLogin);
    }

    //-------------------------------------------------------------------------
    public override void release()
    {
        EbLog.Note("ServerSampleUCenter.release()");
    }

    //-------------------------------------------------------------------------
    public override void update(float elapsed_tm)
    {
    }

    //-------------------------------------------------------------------------
    public override void handleEvent(object sender, EntityEvent e)
    {
    }

    //-------------------------------------------------------------------------
    void _onUCenter2ProjectLogin(LoginData login_data)
    {
        UCenterSDK4Server.project2ucenterOnLogin(true, login_data);
    }
}
